package org.batatasframework.chart.graphics;

import org.batatasframework.chart.columns.ChartColumnAxis;
import org.batatasframework.chart.columns.ColumnAxis2Dimension;

public enum ChartGraphicAxis {
	X {
		@Override
		public ChartColumnAxis resolve(ChartColumnAxis axis) {
			if(axis instanceof ColumnAxis2Dimension){
				return ((ColumnAxis2Dimension) axis).axisX();
			}
			return axis;
		}
	}, Y {
		@Override
		public ChartColumnAxis resolve(ChartColumnAxis axis) {
			if(axis instanceof ColumnAxis2Dimension){
				return ((ColumnAxis2Dimension) axis).axisY();
			}
			throw new RuntimeException("没有定义axis y！");
		}
	};
	
	public abstract ChartColumnAxis resolve(ChartColumnAxis axis);
}
